package com.qd.common.panda.domain.entity.space.publish;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 发布记录
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class ParkSpacePublishLogDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "发布记录ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "发布记录ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String publishLogId;
    /**
     * 租赁开始时间
     */
    private String startDate;
    /**
     * 租赁结束时间
     */
    private String endDate;
    /**
     * 租赁开始小时
     */
    private String startHour;
    /**
     * 租赁结束小时
     */
    private String endHour;
    /**
     * 租赁天数:租赁天数、小时数
     */
    private Long days;
    /**
     * 发布时间
     */
    @NotNull(message = "发布时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime publishTime;
    /**
     * 车位发布ID
     */
    @NotBlank(message = "车位发布ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "车位发布ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String publishId;

    @Override
    public void freeData() {
        this.publishLogId = null;
        this.startDate = null;
        this.endDate = null;
        this.startHour = null;
        this.endHour = null;
        this.days = null;
        this.publishTime = null;
        this.publishId = null;
        super.freeData();
    }
}
